home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / aessrc12 / aesutrs2.s < prev    next >
Text File  |  1990-11-23  |  2KB  |  64 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* AESFAST Public Domain GEM bindings.
  5. ;*
  6. ;*========================================================================
  7.  
  8. ;*************************************************************************
  9. ;*
  10. ;* AESUTRS2.S - Resource-related Utilities 2 of n.
  11. ;*  Non-standard utility functions.
  12. ;*
  13. ;*************************************************************************
  14.  
  15.           .include  "gemfast.sh"
  16.  
  17. ;-------------------------------------------------------------------------
  18. ; rsc_gstrings - Get pointers to strings within a tree.
  19. ;
  20. ;               This function gets one or more string pointers from within
  21. ;               a resource tree.  It knows the difference between strings
  22. ;               and buttons and text objects, and gets the ob_spec or
  23. ;               te_ptext pointer as appropriate. It accepts a variable
  24. ;               number of object/pointer pairs, with a negative object
  25. ;               index indicating the end of the list.
  26. ;
  27. ;               In this function, ptr1, ptr2, etc are the addresses of
  28. ;               the pointers you want to initialize...
  29. ;  void rsc_sstrings(tree, obj1,ptr1 [,obj2,ptr2,...,objn,ptrn], -1);
  30. ;-------------------------------------------------------------------------
  31.  
  32. _rsc_gstrings::
  33.  
  34.           .cargs    #12,.ptree.l,.parms
  35.  
  36.           movem.l    a2-a3,-(sp)            ; Save Laser C register.
  37.           move.l    .ptree(sp),a3
  38.           lea       .parms(sp),a2
  39. .loop:
  40.           move.w    (a2)+,d2
  41.           bmi.s     .done
  42.           move.l    (a2)+,a0
  43.           muls      #OBJ_SIZ,d2
  44.           move.w    ob_type(a3,d2.l),d1
  45.           and.w     #$00FF,d1           ; remove extended object type data
  46.           cmp.w     #G_STRING,d1
  47.           beq.s     .string
  48.           cmp.w     #G_BUTTON,d1
  49.           beq.s     .string
  50. .text:    
  51.           move.l    ob_spec(a3,d2.l),a1
  52.           move.l    (a1),(a0)
  53.           bra.s     .loop
  54. .string:
  55.           move.l    ob_spec(a3,d2.l),(a0)
  56.           bra.s     .loop
  57. .done:
  58.           movem.l    (sp)+,a2-a3            ; Restore Laser C register.
  59.           rts
  60.  
  61.           
  62. ;         end of code
  63.  
  64.